extends ../layout

//- append scripts
  script.
    var cards = JSON.parse('!{cards}');
    $(function () {
      var container = $('#cards').first();
      console.log(cards.length);
      cards && container.append($(Handlebars.templates.admin_list(cards)));
    });

block content
  .container
    h3.text-center: i.fa.fa-list-alt
      |  卡片一览
    hr

  .container
    .row
      .col-sm-4.col-xs-12
        .row
          .col-sm-8
            .list-group
              a.list-group-item(href='/admin/licenses')
                i.fa.fa-fw.fa-ticket.fa-lg
                | &nbsp; 管理制作码
              a.list-group-item(href='/admin/cards')
                i.fa.fa-fw.fa-credit-card.fa-lg.text-success
                | &nbsp; 名片一览
      #cards.col-sm-6.col-xs-12
        .list
          ul.list-group
            each card, index in cards
              li.list-group-item
                span.fa.fa-eye.text-muted.pull-right
                h4.list-group-item-heading= card.name
                p.list-group-item-text
                  a(href="/v/#{card.id}")
                    span ID:&nbsp;
                    | #{card.id}